<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>操作</title>
	<script>
		window.onload= function () {

			title = document.getElementById('title');
			btn = document.getElementById('btn');

			is = true;
			btn.onclick = function () {
				if(is){
					time = setInterval(run,20);
					is = false;
				}else{
					clearInterval(time);
					is=  true;
				}
			}

			num = 0;

			function run() {
				title.style.left =num+"px";
				// title.style.height =num+"px";
				num +=5;
			}


			


		}
	</script>
	<style>
		
		#title{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
			position: absolute;
			top: 0px;
			left: 0px;
		}

	</style>
</head>
<body>
	<input type="button" value="点我" id="btn" >
	<p id="title">学并思</p>
</body>
</html>